7 typedef unsigned long long ull
;
9 inline ull
cube(ull x
){ return x
*x
*x
; }
15 for (ull k
= 1; k
*k
<=n
&& k
<= 29241; ++k
){
20 ull y
= ( -3*k
*k
+ (ull
)sqrt(12*k
*n
- 3*k
*k
*k
*k
) ) / (6*k
);
21 if (y
> 0 && cube(y
+k
) - cube(y
) == n
){
22 // cout << "k: " << k << endl;
23 cout
<< y
+ k
<< " " << y
<< endl
;
29 ull y = ( -3*k*k + (ull)sqrt(12*k*n - 3*k*k*k*k) ) / (6*k);
30 if (y > 0 && cube(y+k) - cube(y) == n){
31 // cout << "k: " << k << endl;
32 cout << y + k << " " << y << endl;
41 cout
<< "No solution" << endl
;